/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "kingdom")
@NamedQueries({
    @NamedQuery(name = "Kingdom.findAll", query = "SELECT k FROM Kingdom k"),
    @NamedQuery(name = "Kingdom.findByIdkingdom", query = "SELECT k FROM Kingdom k WHERE k.idkingdom = :idkingdom"),
    @NamedQuery(name = "Kingdom.findByKingdom", query = "SELECT k FROM Kingdom k WHERE k.kingdom = :kingdom")})
public class Kingdom implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idkingdom")
    private Integer idkingdom;
    @Basic(optional = false)
    @Column(name = "kingdom")
    private String kingdom;
    @OneToMany(mappedBy = "kingdom", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Kingdom() {
    }

    public Kingdom(Integer idkingdom) {
        this.idkingdom = idkingdom;
    }

    public Kingdom(Integer idkingdom, String kingdom) {
        this.idkingdom = idkingdom;
        this.kingdom = kingdom;
    }

    public Integer getIdkingdom() {
        return idkingdom;
    }

    public void setIdkingdom(Integer idkingdom) {
        this.idkingdom = idkingdom;
    }

    public String getKingdom() {
        return kingdom;
    }

    public void setKingdom(String kingdom) {
        this.kingdom = kingdom;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idkingdom != null ? idkingdom.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Kingdom)) {
            return false;
        }
        Kingdom other = (Kingdom) object;
        if ((this.idkingdom == null && other.idkingdom != null) || (this.idkingdom != null && !this.idkingdom.equals(other.idkingdom))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Kingdom[idkingdom=" + idkingdom + "]";
    }

}
